﻿<DemoPageSectionComponent Id="Navigation-Toolbar-RenderStyle" ShowSizeMode="true">
    <ChildContentWithParameters Context="Params">
        <div class="card w-100">
            <div class="card-body">
                <DxToolbar ItemRenderStyleMode="@selectedRenderMode" SizeMode="Params.SizeMode" Title="Toolbar title">
                    <Items>
                        @foreach(var style in btnStyles) {
                            <DxToolbarItem Text="@style.ToString()" RenderStyle="@style" BeginGroup="true">
                            </DxToolbarItem>
                        }
                    </Items>
                </DxToolbar>
            </div>
        </div>
    </ChildContentWithParameters>
    <OptionsContent>
        <OptionComboBox Label="Render Style Mode:"
                        Data="@(Enum.GetNames(typeof(ToolbarRenderStyleMode)))"
                        Value="@(selectedRenderMode.ToString())"
                        ValueChanged="@((string selectedItem) => { selectedRenderMode = Enum.Parse<ToolbarRenderStyleMode>(selectedItem); })"/>
    </OptionsContent>

    @code{
        ToolbarRenderStyleMode selectedRenderMode = ToolbarRenderStyleMode.Contained;
        List<ButtonRenderStyle> btnStyles;
        protected override void OnInitialized() {
            base.OnInitialized();
            btnStyles = new List<ButtonRenderStyle>((ButtonRenderStyle[])Enum.GetValues(typeof(ButtonRenderStyle)));
            @*BeginHide*@
            btnStyles.RemoveAt(0);
            btnStyles.Remove(ButtonRenderStyle.Dark);
            btnStyles.Remove(ButtonRenderStyle.Light);
            btnStyles.Add(ButtonRenderStyle.None);
            @*EndHide*@
        }
    }

</DemoPageSectionComponent>
